package com.j48.entrancegurad.controller;

import com.alibaba.fastjson.JSONArray;
import com.j48.entrancegurad.model.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.j48.entrancegurad.service.IAdminService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;


/***
 * 获取管家信息，传递给后台
 */
@Controller
public class WxStewardController {
    @Autowired
    private IAdminService adminService;

    @RequestMapping(value = "/WxSteward" ,produces = "text/html;charset=UTF-8")
    @ResponseBody
    public String WxSteward(Admin admin,HttpServletRequest request){
        List<Admin> list=new ArrayList<>();
        list=adminService.selectAll();
//        System.out.println(JSONArray.toJSONString(list));
        return JSONArray.toJSONString(list);
    }
}
